package cn.itcast.bos.dao.Impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.itcast.bos.dao.base.IUserDao;
import cn.itcast.bos.domain.User;

@Repository
public class UserDaoImpl extends IBaseDaoImpl<User> implements IUserDao{

	@Override
	public User findByUsername(String username) {
		List<User> list = this.getHibernateTemplate().find("from User where username=?", username);
		if (list != null && list.size()>0) {
			return list.get(0);
		}
		return null;
	}

}
